// /common/http.api.js

// 如果没有通过拦截器配置域名的话，可以在这里写上完整的URL(加上域名部分)

//let indexUrl = '/api/index';api数量太多了 就不写在这里了

// 此处第二个参数vm，就是我们在页面使用的this，你可以通过vm获取vuex等操作，更多内容详见uView对拦截器的介绍部分：
// https://uviewui.com/js/http.html#%E4%BD%95%E8%B0%93%E8%AF%B7%E6%B1%82%E6%8B%A6%E6%88%AA%EF%BC%9F
const install = (Vue, vm) => {
	console.log(vm.$u,1111)
	//定义api属性
	vm.$u.api = {}
	// 此处没有使用传入的params参数
	//获取微信用户的openid
	vm.$u.api.openid = (params = {}) => vm.$u.get('wx/auth/getOpenId', params);
	//微信登录
	vm.$u.api.login = (params = {}) => vm.$u.post('wx/auth/weixin_login', params);
	//获取静态页面内容
	vm.$u.api.getHtml = (params = {}) => vm.$u.get('wx/common/getHtml', params);
	//类目列表
	vm.$u.api.getCategoryList = (params = {}) => vm.$u.get('wx/goods/getCategoryList', params);
	//根据类目id获取商品列表
	vm.$u.api.getGoodsListByCategoryId = (params = {}) => vm.$u.get('wx/goods/getGoodsListByCategoryId', params);
	//商品详情
	vm.$u.api.goodsDetail = (params = {}) => vm.$u.get('wx/goods/detail', params);
	//商品详情 拼团的
	vm.$u.api.goodsDetailByGroup = (params = {}) => vm.$u.get('wx/goods/detailByGroup', params);
	//商品分享
	vm.$u.api.share = (params = {}) => vm.$u.get('wx/goods/share', params);
	//商品搜索
	vm.$u.api.goodsSearch = (params = {}) => vm.$u.get('wx/goods/goodsSearch', params);
	//热卖推荐
	vm.$u.api.sellingRecommend = (params = {}) => vm.$u.get('wx/goods/sellingRecommend', params);
	//猜你喜欢
	vm.$u.api.guessYouLike = (params = {}) => vm.$u.get('wx/goods/guessYouLike', params);
	//商品评价列表
	vm.$u.api.commentsList = (params = {}) => vm.$u.get('wx/goods/commentsList', params);
	//加入、减少购物车
	vm.$u.api.addOrReduceCart = (params = {}) => vm.$u.post('wx/cart/addOrReduceCart', params);
	//购物车列表
	vm.$u.api.cartList = (params = {}) => vm.$u.get('wx/cart/list', params);
	//更改购物车选中状态
	vm.$u.api.cartCheckStatus = (params = {}) => vm.$u.post('wx/cart/cartCheckStatus', params);
	//删除购物车
	vm.$u.api.delCart = (params = {}) => vm.$u.post('wx/cart/delCart', params);
	//清空购物车
	vm.$u.api.emptyCart = (params = {}) => vm.$u.get('wx/cart/emptyCart', params);
	//购物车数量
	vm.$u.api.getCartCount = (params = {}) => vm.$u.get('wx/cart/getCartCount', params);
	
	//用户信息
	vm.$u.api.getUserInfo = (params = {}) => vm.$u.get('wx/user/getUserInfo', params);
	//用户收藏列表
	vm.$u.api.collection = (params = {}) => vm.$u.get('wx/collection/list', params);
	//用户收藏添加或删除
	vm.$u.api.addordelete = (params = {}) => vm.$u.post('wx/collection/addordelete', params);
	//用户收货地址列表
	vm.$u.api.address = (params = {}) => vm.$u.get('wx/address/list', params);
	//添加或更新收货地址
	vm.$u.api.saveOrUpd = (params = {}) => vm.$u.post('wx/address/saveOrUpd', params);
	//所有的区域列表
	vm.$u.api.getAllList = (params = {}) => vm.$u.get('wx/common/getAllList', params);
	//收货地址详情
	vm.$u.api.addressDetail = (params = {}) => vm.$u.get('wx/address/detail', params);
	//添加意见反馈
	vm.$u.api.submitFeedback = (params = {}) => vm.$u.post('wx/common/submitFeedback', params);
	
	//首页轮播图
	vm.$u.api.getHomeSlideshow = (params = {}) => vm.$u.get('wx/home/getHomeSlideshow', params);
	//首页模块商品
	vm.$u.api.getHomeModuleGoods = (params = {}) => vm.$u.get('wx/home/getHomeModuleGoods', params);
	
	//用户优惠券列表
	vm.$u.api.getUserCouponsList = (params = {}) => vm.$u.get('wx/coupons/getUserCouponsList/v1_0_0', params);
	
	//用户足迹
	vm.$u.api.getUserFootprint = (params = {}) => vm.$u.get('wx/user/getUserFootprint', params);
	
	//提交订单
	vm.$u.api.submitOrder = (params = {}) => vm.$u.post('wx/buy/submitOrder', params);
	//商品确认订单
	vm.$u.api.confirmOrder = (params = {}) => vm.$u.post('wx/buy/confirmOrder', params);
	
	//订单详情
	vm.$u.api.orderDetails = (params = {}) => vm.$u.get('wx/order/orderDetails', params);
	//支付订单
	vm.$u.api.orderPay = (params = {}) => vm.$u.post('wx/order/orderPay', params);
	//订单列表
	vm.$u.api.orderList = (params = {}) => vm.$u.get('wx/order/orderList', params);
	//取消订单
	vm.$u.api.orderCancel = (params = {}) => vm.$u.post('wx/order/orderCancel', params);
	//删除订单
	vm.$u.api.orderDel = (params = {}) => vm.$u.post('wx/order/orderDel', params);
	//查看物流
	vm.$u.api.queryLogistics = (params = {}) => vm.$u.get('wx/order/queryLogistics', params);
	//确认收货
	vm.$u.api.confirm = (params = {}) => vm.$u.post('wx/order/confirm', params);
	//评价
	vm.$u.api.comment = (params = {}) => vm.$u.post('wx/order/comment', params);
	//我的评价列表
	vm.$u.api.myCommentsList = (params = {}) => vm.$u.get('wx/order/myCommentsList', params);
	//删除评价
	vm.$u.api.delComments = (params = {}) => vm.$u.post('wx/order/delComments', params);
	//各订单状态数量
	vm.$u.api.getUserOrderCount = (params = {}) => vm.$u.get('wx/order/getUserOrderCount', params);
	
	//获取推荐视频
	vm.$u.api.getRecommendVideo = (params = {}) => vm.$u.get('wx/home/getRecommendVideo', params);
	//品牌视频列表
	vm.$u.api.getVideoList = (params = {}) => vm.$u.get('wx/home/getVideoList', params);
	
	//新类目列表
	vm.$u.api.getNewCategoryList = (params = {}) => vm.$u.get('wx/goods/getNewCategoryList', params);
	
	//获取自提点信息
	vm.$u.api.getSinceSiteInfo = (params = {}) => vm.$u.get('wx/common/getSinceSiteInfo', params);
	
	//订单退款
	vm.$u.api.orderRefund = (params = {}) => vm.$u.post('wx/order/orderRefund', params);
	//申请售后
	vm.$u.api.applyAfterSale = (params = {}) => vm.$u.post('wx/order/applyAfterSale', params);
	//取消售后申请
	vm.$u.api.cancelAfterSale = (params = {}) => vm.$u.post('wx/order/cancelAfterSale', params);
	//获取所有快递公司编码
	vm.$u.api.getAllShipChannelCode = (params = {}) => vm.$u.get('wx/order/getAllShipChannelCode', params);
	//上传退货物流
	vm.$u.api.uploadReturnLogistics = (params = {}) => vm.$u.post('wx/order/uploadReturnLogistics', params);
	//查看退货物流
	vm.$u.api.queryReturnLogistics = (params = {}) => vm.$u.get('wx/order/queryReturnLogistics', params);
	//获取物流地址,订单状态为11用
	vm.$u.api.getReturnAdress = (params = {}) => vm.$u.get('wx/order/getReturnAdress', params);
	
	//获取会员配置列表
	vm.$u.api.getVipConfigList = (params = {}) => vm.$u.get('wx/user/getVipConfigList', params);
	//会员详情
	vm.$u.api.getVipConfigDetail = (params = {}) => vm.$u.get('wx/user/getVipConfigDetail', params);
	//购买会员
	vm.$u.api.byVip = (params = {}) => vm.$u.post('wx/user/byVip', params);
	//判断是否登录
	vm.$u.api.isLogin = (params = {}) => vm.$u.post('wx/auth/isLogin', params);
	//获取公告列表
	vm.$u.api.getNoticeList = (params = {}) => vm.$u.get('wx/home/getNoticeList', params);
	
	//获取首页热门推荐商品列表
	vm.$u.api.getHomeRecommendGoodsList = (params = {}) => vm.$u.get('wx/home/getHomeRecommendGoodsList', params);
	
	//获取首页拼团商品列表
	vm.$u.api.getHomeGroupGoodsList = (params = {}) => vm.$u.get('wx/home/getHomeGroups', params);
	
	
	
	//获取用户团队列表
	vm.$u.api.getUserTeamList = (params = {}) => vm.$u.get('wx/user/getUserTeamList', params);
	//获取用户积分明细列表
	vm.$u.api.getUserPointsDetailList = (params = {}) => vm.$u.get('wx/user/getUserPointsDetailList', params);
	//获取用户佣金明细列表
	vm.$u.api.getUserCommissionDetailList = (params = {}) => vm.$u.get('wx/user/getUserCommissionDetailList', params);
	//获取用户佣金信息
	vm.$u.api.getUserCommissionInfo = (params = {}) => vm.$u.get('wx/user/getUserCommissionInfo', params);
	//获取用户提现记录列表
	vm.$u.api.getUserWithdrawRecordsList = (params = {}) => vm.$u.get('wx/user/getUserWithdrawRecordsList', params);
	//提现
	vm.$u.api.submitWithdraw = (params = {}) => vm.$u.post('wx/user/submitWithdraw', params);
	
	//分类下的商品
	vm.$u.api.getAllGoodsListByCategoryId = (params = {}) => vm.$u.get('wx/goods/getAllGoodsListByCategoryId', params);
	
}

export default {
	install
}